#include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
    void moveZeroes(vector<int>& nums) {
        if (nums.size() <= 1)return;
        int i = 0, j = 0;
        while (i < nums.size())
        {

            while (i < nums.size()&&nums[i] == 0  )
            {
                i++;
            }

            if (i < nums.size() && j < nums.size())
                swap(nums[j++], nums[i++]);
        }

    }
};

int main() {
    vector<int> v = { 0,0 };
    Solution().moveZeroes(v);
    for (auto& e : v)
    {
        cout << e << " ";
    }
    cout << endl;
    return 0;
}
